When the user clicks a menu that contains a menu command, the following chain of events occurs:
1 | If any menuitem tag in the menu contains the dynamic attribute, Dreamweaver calls the getDynamicContent() function in the associated menu command file to populate the menu. |
2 | Dreamweaver calls the canAcceptCommand() function in each menu command file referenced in the menu to check whether the command is appropriate for the selection. If canAcceptCommand() returns FALSE , the menu item is dimmed. If canAcceptCommand() returns TRUE or is not defined, Dreamweaver calls the isCommandChecked() function to determine whether to display a check mark next to the menu item. If the isCommandChecked() function is not defined, no check mark is displayed. |
3 | Dreamweaver calls the setMenuText() function to determine the text that should appear in the menu. If setMenuText() is not defined, Dreamweaver uses the text that is specified in the menuitem tag. |
4 | The user selects an item from the menu. |
5 | Dreamweaver calls the receiveArguments() function, if defined, in the selected menu command file to let the command process any arguments passed from the menu item. |
6 | Dreamweaver calls the commandButtons() function, if defined, to determine which buttons appear along the right side of the options dialog box and what code should be executed when the user clicks the buttons. |
7 | Dreamweaver scans the menu command file for a FORM tag. If a form exists, Dreamweaver calls the windowDimensions() function to determine the size of the options dialog box containing the BODY elements of the file. If windowDimensions() is not defined, the size of the dialog box is determined automatically. |
8 | If the menu command file's BODY tag contains an onLoad handler, Dreamweaver executes the code associated with the handler (regardless of whether a dialog box is displayed). If no dialog box appears, the remaining steps do not occur. |
9 | The user selects options in the dialog box. Dreamweaver executes event handlers associated with the fields as the user encounters them. |
10 | The user clicks one of the buttons defined by commandButtons() . |
11 | Dreamweaver executes the code associated with the clicked button. |
12 | The dialog box remains visible until one of the scripts in the menu command calls window.close() . |
![]() |